import { request, excelRequest } from "../request";

export function maniCountByDate(params) {
  // 日期统计
  return request({
    url: `/product/v31/api/manifest/mermaincountbydate`,
    method: "POST",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function splitCountByDate(params) {
  // 被分账日期统计
  return request({
    url: `/product/v31/api/manifest/mersplitcountbydate`,
    method: "POST",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function maniCount(params) {
  // 统计
  return request({
    url: `/product/v31/api/manifest/mermaincount`,
    method: "POST",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function merSplitCount(params) {
  // 被分账统计
  return request({
    url: `/product/v31/api/manifest/mersplitcount`,
    method: "POST",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function maniTotalCount(params) {
  // 货单总统计
  return excelRequest({
    url: `/product/v31/api/manifest/mermaintotalcount`,
    method: "POST",
    params: params,
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function splitTotalCount(params) {
  // 被分账总统计
  return excelRequest({
    url: `/product/v31/api/manifest/mersplittotalcount`,
    method: "POST",
    params: params,
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function maniexcelByDay(params) {
  // 按日导出
  return excelRequest({
    url: `/product/v31/api/manifest/excelbyday`,
    method: "POST",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function splitexcelByDay(params) {
  // 被分账按日导出
  return excelRequest({
    url: `/product/v31/api/manifest/splitexcelbyday`,
    method: "POST",
    params: params,
    headers: {
      token: sessionStorage.getItem("token"),
    },
  });
}

export function maniexcel(params) {
  // 导出
  return excelRequest({
    url: `/product/v31/api/manifest/excel`,
    method: "POST",
    params: params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}

export function splitexcel(params) {
  // 导出
  return excelRequest({
    url: `/product/v31/api/manifest/splitexcel`,
    method: "POST",
    params: params,
    timeout: "180000",
    headers: {
      "Content-Type": "application/json",
      token: sessionStorage.getItem("token"),
    },
  });
}
